import { defineStore } from 'pinia';

interface MapNoticeItem {
  message: string;
  time: string;
  type: any;
  grade: any;
  alarmRecordId:any;
}

export const mapNoticeStore = defineStore('mapNotice', () => {
  const state = reactive({
    noticesmap: {} as MapNoticeItem
  });

  const addNotices = (noticesmap: MapNoticeItem) => {
    state.noticesmap = noticesmap;
  };

  const removeNotice = (notice: MapNoticeItem) => {
    // state.notices.splice(state.notices.indexOf(notice), 1);
  };

  // 实现全部已读
  const readAll = () => {

  };

  const clearNotice = () => {
  
  };
  return {
    state,
    addNotices,
    removeNotice,
    readAll,
    clearNotice
  };
});

export default mapNoticeStore;
